const ventilate = require('../../service/api/cabines/request/ventilate')
const areaColumnConfiguration = require('../../service/api/cabines/request/areaColumnConfiguration')
const initialStatus = require('../../service/api/cabines/request/initialStatus')
const close = require('../../service/api/cabines/request/close')
const open = require('../../service/api/cabines/request/open')
const stop = require('../../service/api/cabines/request/stop')
const heartbeats = require('../../service/api/cabines/heartbeats')
const setup = require('../../service/api/cabines/setup')
const data= require('../../lib/data')

class CabinesController {
  static async test(ctx){
  
    ctx.body = await heartbeats.test(ctx);
  }
  static async setup(ctx){
    ctx.body = await setup.send(ctx);
  }
  static async open(ctx){
    ctx.body = await open.send(ctx);
  }
  static async stop(ctx){
    ctx.body = await stop.send(ctx);
  }
  static async close(ctx){
    ctx.body = await close.send(ctx);
  }
  static async ventilate(ctx){
    ctx.body = await ventilate.send(ctx);
  }
  static async areaColumnConfiguration(ctx){
    ctx.body =  await areaColumnConfiguration.send(ctx);
  }
  static async initialStatus(ctx){
    ctx.body = await initialStatus.send(ctx);
  }
  
  static async heartbeats(ctx){
  
    ctx.body = await heartbeats.refresh();
  }
 
  static async insert(ctx) {
    ctx.body = await service.insert(ctx.request.body)
  }
  static async delete(ctx) {
    ctx.body = await service.delete(ctx.request.body)
  }
  static async update(ctx) {
    ctx.body = await service.update(ctx.request.body)
  }
}

module.exports = CabinesController